package net.chenlin.dp.base.manager.impl;

import net.chenlin.dp.base.dao.ProjectMapper;
import net.chenlin.dp.base.entity.ProjectEntity;
import net.chenlin.dp.base.manager.ProjectManager;
import net.chenlin.dp.common.entity.Page;
import net.chenlin.dp.common.entity.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 项目管理
 *
 * @author ZhouChenglin
 * @email yczclcn@163.com
 * @url www.chenlintech.com
 * @date 2018年2月02日 下午4:38:50
 */
@Component("projectManager")
public class ProjectManagerImpl implements ProjectManager {

	@Autowired
	private ProjectMapper projectMapper;
	

	@Override
	public List<ProjectEntity> listDpProject(Page<ProjectEntity> page, Query search) {
		return projectMapper.listForPage(page, search);
	}

	@Override
	public int saveDpProject(ProjectEntity dpProject) {
		return projectMapper.save(dpProject);
	}

	@Override
	public ProjectEntity getDpProjectById(Long id) {
		ProjectEntity dpProject = projectMapper.getObjectById(id);
		return dpProject;
	}

	@Override
	public int updateDpProject(ProjectEntity dpProject) {
		return projectMapper.update(dpProject);
	}

	@Override
	public int batchRemove(Long[] id) {
		int count = projectMapper.batchRemove(id);
		return count;
	}
	
}
